package org.example.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author achen
 * @create 2021-05-30 17:00
 */
@RestController
@RefreshScope //允许远程配置修改 自动刷新
public class TestController {

    @Value("${usersname}")
    private String name;

    @GetMapping("test")
    public String test() {
        return name;
    }
}
